import React, { Component } from 'react';
class fskzj extends Component {
  constructor(props) {
    super(props);
    this.state = {  }
  }
  render() { 
    return ( 
      <div>
        {/* 表单的现用现取 */}
        <div>非受控组件</div>
        {/* <form action="/bdzj" onSubmit={this.handleSubmit}> */}
        <form onSubmit={this.handleSubmit}>
          账号：<input ref={e => this.username = e} type="text" name="username"></input>
          密码：<input ref={e => this.password = e} type="password" name="password"></input>
          <button>登陆</button>
        </form>
      </div>
    );
  }
  handleSubmit=(event)=>{
    event.preventDefault(); //阻止默认事件    组织form 表单的默认跳转刷新    
    let { username, password} = this
    console.log(username.value,password.value)
  }
}
 
export default fskzj;